<template name="_houston_navbar">
  <div class="navbar navbar-inverse navbar-fixed-top">

    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse"
                data-target=".navbar-collapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand brand" href="{{pathFor 'houston_home'}}">Houston
          <small>Meteor Admin</small>
        </a>
      </div>
      <div class="navbar-collapse collapse">
        <ul class="nav navbar-nav pull-right">
          {{#if currentUserIsAdmin }}
          {{#each menu_items}}
          <li class="{{isActive}}">
            <a target="{{target}}" href="{{path}}">{{title}}</a>
          </li>
          {{/each}}
          {{/if}}
          <li>
            <a id="houston-report-bug" href="{{bugreport_url}}" target="_blank">
              <i class="fa fa-bug"></i>Report a Bug
            </a>
          </li>
          {{#if currentUser}}
          <li>
            <a href="{{pathFor 'houston_change_password'}}"><i
                class="fa fa-pencil"></i>Change password</a>
          </li>
          <li>
            <a id="houston-logout" href="#">Log out&nbsp;<i
                class="fa fa-sign-out"></i></a>
          </li>
          {{/if}}
        </ul>
      </div>
      <!--/.nav-collapse -->
    </div>

  </div>
</template>

<template name="_houston_sidenav">
  {{#if currentUserIsAdmin}}
  <h6><i class="fa fa-database"></i>Collections</h6>
  <ul class="nav nav-sidebar">
    {{#each collections}}
    <li class="{{#if is_active name}}active{{/if}}">
      <a href="{{pathFor 'houston_collection' collection_name=name }}">
        {{name}}
        <span class="badge pull-right">{{ count }}</span>
      </a>

    </li>
    {{/each}}
  </ul>
  {{/if}}
  <hr>

  <ul class="nav nav-sidebar">
    <!-- Hack because iron router is not letting us link to root -->
    <li onclick="window.location = '/';"><a href="/"><i class="fa fa-reply"></i>Back to Root</a></li>
  </ul>
</template>
